package cn.net.wanji.entity;

import cn.net.wanji.enums.CargoType;
import lombok.Data;

@Data
public class TrafficFlowVehicleDto {
    private String name;
    private Long num;

    // 示例方法：根据枚举类型值获取枚举实例
    public CargoType getCargoType(int value) {
        for (CargoType type : CargoType.values()) {
            for (int i : type.getValue()) {
                if (i == value) {
                    return type;
                }
            }

        }
        throw new IllegalArgumentException("Invalid cargo type value: " + value);
    }

}
